home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Linux Cubed Series 8: LINUX Games
/
Linux Cubed Series 8 - LINUX Games.iso
/
games
/
x11
/
xbattle.pat
/
xbattle.patch
Wrap
Text File
|
1995-01-02
|
2KB
|
59 lines
For some reason xbattle seems to croak at the __asm__ line for FD_SET in
the <linux/types.h> file. I found an alternate definition for FD_SET, etc in
<gnu/types.h> and made a patch to have the compiler use these instead. I
admit not really knowing much about why it fails without the patch, but it
compiles rather cleanly with it.
Don't worry, this only changes main.c, not <linux/types.h>. ;)
darron@griffin.sccsi.com
*** main.c.orig Sun Sep 27 11:52:19 1992
--- main.c Mon Jan 2 18:47:02 1995
***************
*** 12,21 ****
--- 12,54 ----
#if UNIX
#include <sys/types.h>
#include <sys/time.h>
#endif
+ /*********************************/
+ /* Patches to compile from linux */
+
+ #undef __FD_SETSIZE
+ #define __FD_SETSIZE 256
+
+ /* It's easier to assume 8-bit bytes than to get CHAR_BIT. */
+ #undef __NFDBITS
+ #define __NFDBITS (sizeof(unsigned long int) * 8)
+ #undef __FDELT(d)
+ #define __FDELT(d) ((d) / __NFDBITS)
+ #undef __FDMASK(d)
+ #define __FDMASK(d) (1 << ((d) % __NFDBITS))
+
+ typedef struct
+ {
+ unsigned long int fds_bits [(__FD_SETSIZE + (__NFDBITS - 1)) / __NFDBITS];
+ } __fd_set;
+
+ /* This line MUST be split! Otherwise m4 will not change it. */
+ #undef __FD_ZERO(set)
+ #define __FD_ZERO(set) \
+ ((void) memset((__ptr_t) (set), 0, sizeof(fd_set)))
+ #undef __FD_SET
+ #define __FD_SET(d, set) ((set)->fds_bits[__FDELT(d)] |= __FDMASK(d))
+ #undef __FD_CLR
+ #define __FD_CLR(d, set) ((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d))
+ #undef __FD_ISSET
+ #define __FD_ISSET(d, set) ((set)->fds_bits[__FDELT(d)] & __FDMASK(d))
+
+ /* End linux patches */
+ /*********************************/
+
/*************************************************************************/
/** xbattle **/
/** **/
/** Steve Lehar (slehar@park.bu.edu) **/
/** Greg Lesher (lesher@park.bu.edu) **/